import { TPetExploreConfig } from "../../../../Message/Db/Tables/TPetExploreConfig";
import { ItemData } from "./ItemData";
import { ItemsUtil } from "../../view/shortcuts/item/ItemsUtil";
import { BossConfig } from "../BossConfig";
import { TBoss } from "../../../../Message/Db/Tables/TBoss";
type int = number;
//class PetExploreConfigInfo
    
    export  class PetExploreConfigInfo extends TPetExploreConfig
    {
        constructor()
        {
            
            super();this._bossDropArray = [];
            this._dropArray = [];
            this._bossInfoArray = [];
            return;
        }

        public parse(): void
        {
            var loc2=null;
            var loc5=null;
            var loc6=null;
            var loc9=0;
            var loc10=null;
            var loc1=bossDrops.split("#");
            var loc3=0;
            while (loc3 < loc1.length) 
            {
                loc2 = new ItemData(int(loc1[loc3]));
                this._bossDropArray.push(loc2);
                ++loc3;
            }
            var loc4=dropItems.split("#");
            var loc7=0;
            while (loc7 < loc4.length) 
            {
                loc5 = new ItemData(int(loc4[loc7]));
                this._dropArray.push(loc5);
                if (loc7 != (loc4.length - 1)) 
                {
                    loc6 = "、";
                }
                else 
                {
                    loc6 = "";
                }
                this._dropItemName = this._dropItemName + (ItemsUtil.getItemName(loc5) + loc6);
                ++loc7;
            }
            var loc8=bossIds.split("#");
            var loc11=0;
            while (loc11 < loc8.length) 
            {
                loc9 = int(loc8[loc11]);
                if (loc10 = BossConfig.instance.getInfoByCode(loc9).boss) 
                {
                    this._bossInfoArray.push(loc10);
                }
                ++loc11;
            }
            return;
        }

        public get bossDropArray(): Array<any>
        {
            return this._bossDropArray;
        }

        public get dropArray(): Array<any>
        {
            return this._dropArray;
        }

        public set dropArray(arg1: Array<any>)
        {
            this._dropArray = arg1;
            return;
        }

        public get dropItemName(): string
        {
            return this._dropItemName;
        }

        public get bossInfoArray(): Array<any>
        {
            return this._bossInfoArray;
        }

        public isBoss(arg1: int): Boolean
        {
            var loc1=null;
            var loc2=0;
            var loc3=this._bossInfoArray;
            for(loc1 of loc3) 
            {
                if (loc1.code != arg1) 
                {
                    continue;
                }
                return true;
            }
            return false;
        }

        public getBossIndexById(arg1: int): int
        {
            var loc1=null;
            var loc2=0;
            while (loc2 < this.bossInfoArray.length) 
            {
                loc1 = this.bossInfoArray[loc2] as TBoss;
                if (arg1 == loc1.code) 
                {
                    return loc2;
                }
                ++loc2;
            }
            return -1;
        }

        /* internal */ /* var */_bossDropArray: Array<any>;

        /* internal */ /* var */_dropArray: Array<any>;

        /* internal */ /* var */_bossInfoArray: Array<any>;

        /* internal */ /* var */_dropItemName: string="";
    }
